package com.fingard.dsp.localdb;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.fingard.db.JDBCHelper;

/**本地库的常用方法类*/
public class LocalDbHelper {

	/**获取所有表名
	 * @throws SQLException */
	public static ArrayList<String> getTableNameList(Connection pConn ) throws SQLException{
		ArrayList<String> list = new ArrayList<String>();
		String sqlchk = "select * from sqlite_master where type='table' order by name";
		List<Map<String,Object>> tabList=JDBCHelper.execQuery(pConn, sqlchk, null);
		if(tabList!=null&&tabList.size()>0){
			for(Map<String,Object> eachMap:tabList){
				list.add(String.valueOf(eachMap.get("NAME")));
			}
		}
		return list;
	}
}
